import type { AppRouteModule } from '/@/router/types';
import { RoleEnum } from '/@/enums/roleEnum';
import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const Goods: AppRouteModule = {
  path: '/goods',
  name: 'Goods',
  component: LAYOUT,
  redirect: '/goods/goodsList',
  meta: {
    orderNo: 10,
    icon: 'ant-design:reddit-circle-filled',
    title: t('routes.demo.goods.Title'),
    roles: [RoleEnum.ADMIN, RoleEnum.OTHER, RoleEnum.MERCHANT],
  },
  children: [
    {
      path: 'goodsList',
      name: 'GoodsList',
      meta: {
        title: t('routes.demo.goods.goodsList'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER, RoleEnum.MERCHANT],
      },
      component: () => import('/@/views/locality/goods/goodsList.vue'),
    },
    {
      path: 'goodsType',
      name: 'GoodsType',
      meta: {
        title: t('routes.demo.goods.goodsType'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER, RoleEnum.MERCHANT],
      },
      component: () => import('/@/views/locality/goods/goodsType.vue'),
    },
    {
      path: 'goodsOrder',
      name: 'GoodsOrder',
      meta: {
        title: t('routes.demo.goods.goodsOrder'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER, RoleEnum.MERCHANT],
      },
      component: () => import('/@/views/locality/goods/goodsOrder.vue'),
    },
  ],
};

export default Goods;
